Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzu_object.h File Reference

Base structure for scene graph nodes. More...

Data Structures

struct  KzuObjectNodeTreeIterator
 Read-only iterator for object node tree. More...
 
struct  KzuObjectNodeChildIterator
 Iterator for object node children that supports removing the current child. More...
 

Macros

#define kzuObjectNodeTreeIterate(iterator_param)
 Finds the next entry in the object node tree iterator. More...
 
#define kzuObjectNodeTreeIteratorGetValue(iterator_param)
 Returns the current object node in the object node tree iterator. More...
 
#define kzuObjectNodeChildIterate(iterator_param)
 Finds the next entry in the object node child iterator. More...
 
#define kzuObjectNodeChildIteratorGetValue(iterator_param)
 Returns the current object node in the object node child iterator. More...
 
#define kzuObjectNodeChildIteratorRemove(iterator_param)
 Removes the current child object node from the iterated object node. More...
 

Enumerations

enum  KzuObjectNodeHorizontalAlignment {
  KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_LEFT, KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_RIGHT, KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_CENTER, KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_STRETCH,
  KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_COUNT
}
 Horizontal alignment. More...
 
enum  KzuObjectNodeVerticalAlignment {
  KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_BOTTOM, KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_TOP, KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_CENTER, KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_STRETCH,
  KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_COUNT
}
 Vertical alignment. More...
 
enum  KzuObjectNodeDepthAlignment {
  KZU_OBJECT_NODE_DEPTH_ALIGNMENT_BACK, KZU_OBJECT_NODE_DEPTH_ALIGNMENT_FRONT, KZU_OBJECT_NODE_DEPTH_ALIGNMENT_CENTER, KZU_OBJECT_NODE_DEPTH_ALIGNMENT_STRETCH,
  KZU_OBJECT_NODE_DEPTH_ALIGNMENT_COUNT
}
 Depth alignment. More...
 

Functions

kzsError kzuObjectNodeInitialize (struct KzuObjectNode *objectNode)
 Initializes an object node. More...
 
kzsError kzuObjectNodeUninitialize (struct KzuObjectNode *objectNode)
 Uninitializes an object node. More...
 
kzsError kzuObjectNodeLoadFromKZB (struct KzuObjectNode *objectNode, struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file)
 Loads object node from binary. More...
 
kzsError kzuObjectNodeDelete (struct KzuObjectNode *objectNode)
 Deletes an object node and all its children recursively. More...
 
kzsError kzuObjectNodeDeleteAsync (struct KzuObjectNode *object)
 Deletes an object node and all its children in the idle loop. More...
 
struct KzuPropertyManager * kzuObjectNodeGetPropertyManager (const struct KzuObjectNode *objectNode)
 Get the property manager associated with an object node. More...
 
struct KzuMessageDispatcherkzuObjectNodeGetMessageDispatcher (const struct KzuObjectNode *objectNode)
 Get the message dispatcher associated with an object node. More...
 
struct KzuUIDomainkzuObjectNodeGetUIDomain (const struct KzuObjectNode *objectNode)
 Get the UIDomain associated with an object node. More...
 
kzsError kzuObjectNodeRemoveKZBData (const struct KzuObjectNode *objectNode)
 Destroys all object node data loaded from KZB, including properties, bindings, triggers, resources etc. More...
 
kzsError kzuObjectNodeCopy (const struct KzcMemoryManager *memoryManager, const struct KzuObjectNode *sourceObject, struct KzuObjectNode **out_objectNode)
 Creates a copy of given object node without any of its descendants. More...
 
kzsError kzuObjectNodeCopyWithChildren (const struct KzcMemoryManager *memoryManager, const struct KzuObjectNode *sourceObject, struct KzuObjectNode **out_objectNode)
 Creates a copy of given object node and all its descendants. More...
 
struct KzuObjectNodekzuObjectNodeGetParent (const struct KzuObjectNode *objectNode)
 Gets the parent of an object node. More...
 
kzsError kzuObjectNodeRemoveFromParent (struct KzuObjectNode *objectNode)
 Removes object from parent, if there is such. More...
 
kzBool kzuObjectNodeIsAncestorOf (const struct KzuObjectNode *parentNode, const struct KzuObjectNode *childNode)
 Returns whether the parent node is the parent of the child node at any level in the scene graph hierarchy. More...
 
void kzuObjectNodeSetIsRenderable (struct KzuObjectNode *objectNode, kzBool state)
 Sets whether the object node is renderable. More...
 
kzBool kzuObjectTypeIsRenderable (const struct KzuObjectNode *objectNode)
 Returns whether given object node is renderable. More...
 
struct KzuObjectNodekzuObjectNodeGetSceneObject (const struct KzuObjectNode *objectNode)
 Gets the scene object node that contains the given object node. More...
 
struct KzuScenekzuObjectNodeGetScene (const struct KzuObjectNode *objectNode)
 As kzuObjectNodeGetSceneObject, but return as scene. More...
 
struct KzuLayerkzuObjectNodeGetParentLayer (const struct KzuObjectNode *objectNode)
 Gets the closest layer that is a parent of the given object node. More...
 
struct KzuLayerkzuObjectNodeGetRootLayer (struct KzuObjectNode *objectNode)
 Gets the root layer that contains the given object node. More...
 
struct KzuObjectNodekzuObjectNodeGetRoot (struct KzuObjectNode *objectNode)
 Gets the root object node from the given object, i.e. More...
 
struct KzuScreenkzuObjectNodeGetScreen (struct KzuObjectNode *objectNode)
 Gets the root screen object from the given object. More...
 
kzBool kzuObjectNodeIsAttached (const struct KzuObjectNode *objectNode)
 Returns KZ_TRUE if the object node is attached to a screen or one of its descendants. More...
 
kzBool kzuObjectNodeIsDetaching (const struct KzuObjectNode *objectNode)
 Returns KZ_TRUE during the call to virtual kzuObjectNodeOnDetached and KZ_FALSE otherwise. More...
 
kzsException kzuObjectNodeAddChild (struct KzuObjectNode *parentObject, struct KzuObjectNode *childNode)
 Adds a child node for object node. More...
 
kzsException kzuObjectNodeAddChildAtIndex (struct KzuObjectNode *parentObject, kzUint index, struct KzuObjectNode *childNode)
 Adds a child node for object node to given index. More...
 
kzsError kzuObjectNodeRemoveChild (struct KzuObjectNode *parentObject, struct KzuObjectNode *childObject)
 Removes child node from parent object. More...
 
kzsError kzuObjectNodeRemoveChildByIndex (struct KzuObjectNode *parentObject, kzUint index)
 Removes child node from parent object node at specified index. More...
 
kzsError kzuObjectNodeRemoveAllChildren (struct KzuObjectNode *parentObject)
 Removes all child nodes from parent object. More...
 
kzBool kzuObjectNodeHasChild (const struct KzuObjectNode *parentObjectNode, const struct KzuObjectNode *childObjectNode)
 Checks if parent object node contains child object node. More...
 
kzBool kzuObjectNodeHasChildSafe (const struct KzuObjectNode *parentObjectNode, const struct KzuObjectNode *childObjectNode)
 Checks if parent object node contains child object node. More...
 
kzUint kzuObjectNodeGetChildCount (const struct KzuObjectNode *parentObject)
 Gets child count from object. More...
 
struct KzcDynamicArrayIterator kzuObjectNodeGetChildren (const struct KzuObjectNode *objectNode)
 Returns child objects as iterator from object node. More...
 
struct KzuObjectNodekzuObjectNodeGetChildAtIndex (const struct KzuObjectNode *objectNode, kzUint index)
 Returns a child from given index from object node. More...
 
kzsError kzuObjectNodeGetIndexOfChild (const struct KzuObjectNode *parentObjectNode, const struct KzuObjectNode *childObjectNode, kzUint *out_index)
 Returns the index of a child in an object node. More...
 
kzsError kzuObjectNodeSetName (struct KzuObjectNode *objectNode, kzString name)
 Sets a name for object node. More...
 
kzString kzuObjectNodeGetName (const struct KzuObjectNode *objectNode)
 Returns an object node's name. More...
 
kzsError kzuObjectNodeGetPath (const struct KzuObjectNode *objectNode, kzMutableString *out_path)
 Returns the full path to this object node. More...
 
kzsError kzuObjectNodeGetPathForStudio (const struct KzuObjectNode *objectNode, kzMutableString *out_path)
 Returns a studio-friendly (not including nodes that studio does not know about) full path to this object node. More...
 
kzUint kzuObjectNodeGetTreeHeight (struct KzuObjectNode *objectNode)
 Gets tree height from the object node to the parent, if no parents, height = 1, if single parent, and parent's parent = NULL, height = 2 and so on. More...
 
kzsError kzuObjectNodeGetRelativePath (struct KzuObjectNode *targetObjectNode, struct KzuObjectNode *baseObjectNode, kzMutableString *out_path)
 Returns the relative path from base object node to target object node, KZ_NULL if not found. More...
 
kzBool kzuObjectNodeIsTypeOf (const struct KzuObjectNode *objectNode, const KzuObjectType objectType)
 Returns whether object node or one of its base types is of the given type. More...
 
KzuObjectType kzuObjectNodeGetType (const struct KzuObjectNode *objectNode)
 Returns object node's type, KZU_OBJECT_TYPE_X. More...
 
struct KzcVector3 kzuObjectNodeGetPositionVector (const struct KzuObjectNode *objectNode)
 Returns the position of the object node as vector3. More...
 
kzsError kzuObjectNodeSetIdentityTransformation (const struct KzuObjectNode *objectNode)
 Sets an identity matrix for object node. More...
 
kzsError kzuObjectNodeSetIdentity3x3Transformation (const struct KzuObjectNode *objectNode)
 Sets a top left 3x3 part of object node transformation as identity (clear rotation & scaling). More...
 
kzsError kzuObjectNodeTranslate (const struct KzuObjectNode *objectNode, kzFloat x, kzFloat y, kzFloat z)
 Translates object node. More...
 
kzsError kzuObjectNodeSetPosition (const struct KzuObjectNode *objectNode, kzFloat x, kzFloat y, kzFloat z)
 Sets position for object node. More...
 
kzsError kzuObjectNodeRotate (const struct KzuObjectNode *objectNode, kzFloat angleInDegrees, kzFloat x, kzFloat y, kzFloat z)
 Rotates object node by specific axis, rotation angle in degrees. More...
 
kzsError kzuObjectNodeScale (const struct KzuObjectNode *objectNode, kzFloat scale)
 Scales object node uniformly. More...
 
kzsError kzuObjectNodeScaleXYZ (const struct KzuObjectNode *objectNode, kzFloat scaleX, kzFloat scaleY, kzFloat scaleZ)
 Scales object node non-uniformly. More...
 
struct KzuObjectNodekzuObjectNodeFindFirstChildOfType (struct KzuObjectNode *rootObjectNode, KzuObjectType objectType)
 Finds first object node of given type from root nodes' hierarchy. More...
 
struct KzuObjectNodekzuObjectNodeFindObjectNodeByName (struct KzuObjectNode *rootObjectNode, kzString objectName)
 Finds object node from root nodes' hierarchy by object name. More...
 
struct KzuObjectNodekzuObjectNodeFindObjectNodeContainingPropertyType (struct KzuObjectNode *rootObjectNode, const struct KzuPropertyType *propertyType)
 Finds first object node from root nodes' hierarchy. More...
 
kzsError kzuObjectNodeOnPropertyChanged (struct KzuObjectNode *objectNode, const struct KzuPropertyType *propertyType, enum KzuPropertyNotificationReason reason)
 Notifies the object node about a changed property. More...
 
kzsError kzuObjectNodeGetBoundingVolume (const struct KzuObjectNode *objectNode, struct KzuBoundingVolume **out_boundingVolume)
 Gets bounding volume from object node. More...
 
kzsError kzuObjectNodeRender (struct KzuRenderer *renderer, const struct KzuObjectNode *objectNode, const struct KzuTransformedObjectNode *transformedObjectNode, struct KzcMatrix4x4 *worldTransformation)
 Renders the object if the object type has specified a renderer function. More...
 
kzsError kzuObjectNodeGetSize (const struct KzuObjectNode *objectNode, struct KzcVector3 *out_size)
 Returns the size of given object node. More...
 
kzsError kzuObjectNodeGetMaximumBoundingBoxCoordinates (const struct KzuObjectNode *objectNode, struct KzcVector3 *out_size)
 Returns the minimum coordinates for given object nodes bounding volume. More...
 
kzsError kzuObjectNodeGetMinimumBoundingBoxCoordinates (const struct KzuObjectNode *objectNode, struct KzcVector3 *out_size)
 Returns the maximum coordinates for given object nodes bounding volume. More...
 
kzsError kzuObjectNodeAddResource (const struct KzuObjectNode *objectNode, kzString resourceId, kzString resourceUrl)
 Adds a resource manager resource to an object node. More...
 
kzsError kzuObjectNodeRemoveResource (const struct KzuObjectNode *objectNode, kzString resourceId)
 Removes a resource with given ID from object node resource dictionary. More...
 
kzBool kzuObjectNodeContainsResource (const struct KzuObjectNode *objectNode, kzString resourceID)
 Returns if object node resource dictionary contains the resource with given ID. More...
 
kzsError kzuObjectNodeAddAnonymousResource (struct KzuObjectNode *objectNode, struct KzuResource *resource)
 Adds anonymous resource (such as style) for object node resources. More...
 
kzsError kzuObjectNodeRemoveAnonymousResource (struct KzuObjectNode *objectNode, struct KzuResource *resource)
 Removes anonymous resource from object node resources. More...
 
kzsError kzuObjectNodeAddAnonymousResourceURL (struct KzuObjectNode *objectNode, kzString resourceURL)
 Adds anonymous resource (such as style) acquired from the given URL for object node resources. More...
 
kzsError kzuObjectNodeRemoveAnonymousResourceURL (struct KzuObjectNode *objectNode, kzString resourceURL)
 Removes anonymous resource from the given URL from object node resources. More...
 
kzsError kzuObjectNodeAddAliasResource (const struct KzuObjectNode *objectNode, kzString resourceId, kzString targetPath)
 Adds alias resource to an object node. More...
 
kzsError kzuObjectNodeRemoveAliasResource (const struct KzuObjectNode *objectNode, kzString resourceId)
 Removes alias resource from an object node. More...
 
kzsException kzuObjectNodeAcquireResource (const struct KzuObjectNode *objectNode, kzString resourceId, struct KzuResource **out_resource)
 Acquires a resource from the object node or the node's closest ancestor having the resource. More...
 
kzsError kzuObjectNodeCopyResources (const struct KzuObjectNode *sourceObjectNode, struct KzuObjectNode *targetObjectNode, kzBool preserveTarget)
 Copy resources from one object node to another. More...
 
struct KzcDynamicArrayIterator kzuObjectNodeGetResources (const struct KzuObjectNode *objectNode)
 Gets all resources of the object node. More...
 
struct
KzuObjectNodeResourceDictionary
kzuObjectNodeGetResourceDictionary (const struct KzuObjectNode *objectNode)
 Gets all resources of the object node. More...
 
kzsError kzuObjectNodeAttachInputManipulator (struct KzuObjectNode *objectNode, struct KzuInputManipulator *inputManipulator)
 Transfers the ownership and attaches an input manipulator to an object node. More...
 
kzsError kzuObjectNodeDetachInputManipulator (const struct KzuObjectNode *objectNode, struct KzuInputManipulator *inputManipulator)
 Removes the ownership and detaches an input manipulator from an object node. More...
 
struct KzcDynamicArrayIterator kzuObjectNodeGetInputManipulators (const struct KzuObjectNode *objectNode)
 Gets the input manipulator iterator. More...
 
kzsError kzuObjectNodeAddBinding (struct KzuObjectNode *objectNode, struct KzuBindingRule *rule)
 Transfers the ownership of a binding rule to an object node. More...
 
kzsError kzuObjectNodeAddBindingWithOwner (struct KzuObjectNode *objectNode, struct KzuBindingRule *rule, const void *owner)
 Transfers the ownership of a binding rule to an object node and sets the owner of binding rule. More...
 
kzsError kzuObjectNodeRemoveBinding (const struct KzuObjectNode *objectNode, struct KzuBindingRule *rule)
 Removes the ownership and detaches a binding rule from an object node. More...
 
struct KzcDynamicArrayIterator kzuObjectNodeGetBindings (const struct KzuObjectNode *objectNode)
 Gets the bindings iterator. More...
 
kzsError kzuObjectNodeAddTrigger (struct KzuObjectNode *objectNode, struct KzuTrigger *trigger)
 Transfers the ownership of a trigger to an object node. More...
 
kzsError kzuObjectNodeAddTriggerWithOwner (struct KzuObjectNode *objectNode, struct KzuTrigger *trigger, const void *owner)
 Transfers the ownership of a trigger to an object node and sets the owner of the trigger. More...
 
kzsError kzuObjectNodeRemoveTrigger (const struct KzuObjectNode *objectNode, struct KzuTrigger *trigger)
 Removes the ownership of a trigger from an object node. More...
 
struct KzcDynamicArrayIterator kzuObjectNodeGetTriggers (const struct KzuObjectNode *objectNode)
 Gets the trigger iterator. More...
 
kzsError kzuObjectNodeSetTransformation (const struct KzuObjectNode *objectNode, const struct KzcMatrix4x4 *value)
 Sets object node transformation from matrix. More...
 
struct KzcMatrix4x4 kzuObjectNodeGetTransformation (const struct KzuObjectNode *objectNode)
 Calculates the node transformation from scaling, rotation, and translation properties. More...
 
kzsError kzuObjectNodeSetLayoutTransformation (struct KzuObjectNode *objectNode, const struct KzcMatrix4x4 *value)
 Sets the layout transformation of the object. More...
 
kzsError kzuObjectNodeGetLayoutTransformation (struct KzuObjectNode *objectNode, struct KzcMatrix4x4 *out_value)
 Gets the layout transformation of the object. More...
 
void kzuObjectNodeSetFinalTransformation (struct KzuObjectNode *objectNode, const struct KzcMatrix4x4 *value)
 Sets the final transformation of the object. More...
 
void kzuObjectNodeGetFinalTransformation (const struct KzuObjectNode *objectNode, struct KzcMatrix4x4 *out_value)
 Gets the final transformation of the object. More...
 
struct KzcMatrix4x4 kzuObjectNodeGetBaseTransformationDefaultFromSRT (const struct KzuObjectNode *objectNode)
 Calculates the node base transformation from scaling, rotation, and translation properties. More...
 
kzBool kzuObjectNodeIsEffectivelyVisible (const struct KzuObjectNode *objectNode)
 Checks if the node and all of its ancestors are visible. More...
 
kzBool kzuObjectNodeIsEffectivelyEnabled (const struct KzuObjectNode *objectNode)
 Checks if the node and all of its ancestors are enabled. More...
 
void kzuObjectNodeSetChangeFlag (struct KzuObjectNode *objectNode, kzU32 flag)
 Set a change flag. More...
 
void kzuObjectNodeClearChangeFlag (struct KzuObjectNode *objectNode, kzU32 flag)
 Clear a change flag. More...
 
kzBool kzuObjectNodeIsChangeFlagSet (const struct KzuObjectNode *objectNode, kzU32 flag)
 Check if a change flag is set. More...
 
void kzuObjectNodeSetChildChangeFlag (struct KzuObjectNode *objectNode, kzU32 flag)
 Set an child change flag. More...
 
void kzuObjectNodeClearChildChangeFlag (struct KzuObjectNode *objectNode, kzU32 flag)
 Clear an child change flag. More...
 
kzBool kzuObjectNodeIsChildChangeFlagSet (const struct KzuObjectNode *objectNode, kzU32 flag)
 Check if child change flags match. More...
 
kzBool kzuObjectNodeIsAnyChildChangeFlagSet (const struct KzuObjectNode *objectNode, kzU32 flag)
 Check if any child change flags (corresponding to given mask) are set. More...
 
kzBool kzuObjectNodeIsInvalidLayout (const struct KzuObjectNode *objectNode)
 Check if layout is invalid for a node. More...
 
void kzuObjectNodeInvalidateLayout (struct KzuObjectNode *objectNode)
 Invalidate layout for an object node. More...
 
void kzuObjectNodeInvalidateLayoutRecursive (struct KzuObjectNode *objectNode)
 Invalidate layout for an object node and all of its children. More...
 
void kzuObjectNodeValidateLayout (struct KzuObjectNode *objectNode)
 Validate layout for an object node. More...
 
kzBool kzuObjectNodeIsInvalidArrange (const struct KzuObjectNode *objectNode)
 Check if a node needs arrange. More...
 
void kzuObjectNodeInvalidateArrange (struct KzuObjectNode *objectNode)
 Invalidate arrange. More...
 
void kzuObjectNodeValidateArrange (struct KzuObjectNode *objectNode)
 Validate arrange. More...
 
kzBool kzuObjectNodeIsInvalidRender (const struct KzuObjectNode *objectNode)
 Returns if object node render flag is invalid. More...
 
void kzuObjectNodeValidateRender (struct KzuObjectNode *objectNode)
 Validates render for object node. More...
 
void kzuObjectNodeInvalidateRender (struct KzuObjectNode *objectNode)
 Invalidates render for object node. More...
 
void kzuObjectNodeInvalidateRenderRecursive (struct KzuObjectNode *objectNode)
 Invalidates render recursively for object node. More...
 
kzBool kzuObjectNodeIsInvalidRenderTree (const struct KzuObjectNode *objectNode)
 Returns if object node render tree flag is invalid. More...
 
void kzuObjectNodeValidateRenderTree (struct KzuObjectNode *objectNode)
 Validates render tree flag of object node. More...
 
void kzuObjectNodeInvalidateRenderTree (struct KzuObjectNode *objectNode)
 Invalidates render tree flag of object node. More...
 
kzBool kzuObjectNodeIsInvalidRenderSubmask (const struct KzuObjectNode *objectNode)
 Returns if object render sub mask flag is invalid. More...
 
void kzuObjectNodeInvalidateRenderSubmask (struct KzuObjectNode *objectNode)
 Invalidates render submask for object node. More...
 
kzBool kzuObjectNodeIsInvalidPartialRenderingObject (const struct KzuObjectNode *objectNode)
 Helper function for observing if object is invalid partial rendering object (needs re-render). More...
 
void kzuObjectNodeInvalidatePartialRenderingObject (struct KzuObjectNode *objectNode)
 Helper function for invalidating partial rendering object (rerender will be required with partial rendering). More...
 
void kzuObjectNodeIsInvalidPartialRenderingObjectRecursive (struct KzuObjectNode *objectNode)
 Helper function for invvalidating partial rendering object recursively (rerender will be required with partial rendering). More...
 
void kzuObjectNodeValidatePartialRenderingObject (struct KzuObjectNode *objectNode)
 Helper function for validating partial rendering object (no more rerender is required). More...
 
kzBool kzuObjectNodeIsInvalidPartialRenderingTree (const struct KzuObjectNode *objectNode)
 Helper function for observing if object triee is invalid for partial rendering (needs re-render). More...
 
void kzuObjectNodeInvalidatePartialRenderingTree (struct KzuObjectNode *objectNode)
 Helper function for invalidating partial rendering tree (rerender will be required). More...
 
void kzuObjectNodeValidatePartialRenderingTree (struct KzuObjectNode *objectNode)
 Helper function for validating partial rendering tree (no more rerender is required). More...
 
kzsError kzuObjectNodeSetContentDesiredSize (struct KzuObjectNode *objectNode, const struct KzcVector3 *contentDesiredSize)
 Set content desired size for an object. More...
 
kzsError kzuObjectNodeGetContentDesiredSize (struct KzuObjectNode *objectNode, struct KzcVector3 *contentDesiredSize)
 Get content desired size of an object. More...
 
kzsError kzuObjectNodeSetCoreDesiredSize (struct KzuObjectNode *objectNode, const struct KzcVector3 *coreDesiredSize)
 Set core desired size for an object. More...
 
kzsError kzuObjectNodeGetCoreDesiredSize (struct KzuObjectNode *objectNode, struct KzcVector3 *coreDesiredSize)
 Get core desired size of an object. More...
 
kzsError kzuObjectNodeSetDesiredSize (struct KzuObjectNode *objectNode, const struct KzcVector3 *desiredSize)
 Set desired size for an object. More...
 
kzsError kzuObjectNodeGetDesiredSize (struct KzuObjectNode *objectNode, struct KzcVector3 *desiredSize)
 Get desired size for of object. More...
 
kzsError kzuObjectNodeSetAllocatedSize (struct KzuObjectNode *objectNode, const struct KzcVector3 *layoutSize)
 Set allocated size for an object. More...
 
kzsError kzuObjectNodeGetAllocatedSize (struct KzuObjectNode *objectNode, struct KzcVector3 *layoutSize)
 Get allocated size of an object. More...
 
kzsError kzuObjectNodeSetActualSize (struct KzuObjectNode *objectNode, const struct KzcVector3 *actualSize)
 Set actual size for an object. More...
 
kzsError kzuObjectNodeGetActualSize (struct KzuObjectNode *objectNode, struct KzcVector3 *actualSize)
 Get actual size of an object. More...
 
kzsError kzuObjectNodeSetLayoutBoundingBoxSize (struct KzuObjectNode *objectNode, const struct KzcVector3 *bboxMin, const struct KzcVector3 *bboxMax)
 Set bounding box size for an object. More...
 
kzsError kzuObjectNodeGetLayoutBoundingBoxSize (struct KzuObjectNode *objectNode, struct KzcVector3 *out_bboxMin, struct KzcVector3 *out_bboxMax)
 Get bounding box size for an object. More...
 
kzsError kzuObjectNodeSetAllocatedOffset (struct KzuObjectNode *objectNode, const struct KzcVector3 *allocatedOffset)
 Set allocated offset for an object. More...
 
kzsError kzuObjectNodeGetAllocatedOffset (struct KzuObjectNode *objectNode, struct KzcVector3 *allocatedOffset)
 Get allocated offset of an object. More...
 
kzsError kzuObjectNodeSetStretchScale (struct KzuObjectNode *objectNode, const struct KzcVector3 *stretchScale)
 Set stretch scale for an object. More...
 
kzsError kzuObjectNodeGetStretchScale (struct KzuObjectNode *objectNode, struct KzcVector3 *stretchScale)
 Get stretch scale of an object. More...
 
kzsError kzuObjectNodeSetPivotOffset (struct KzuObjectNode *objectNode, const struct KzcVector3 *pivotOffset)
 Set pivot offset for an object. More...
 
kzsError kzuObjectNodeGetPivotOffset (struct KzuObjectNode *objectNode, struct KzcVector3 *pivotOffset)
 Get pivot offset of an object. More...
 
kzsError kzuObjectNodeDefaultMeasure (struct KzuObjectNode *objectNode)
 Perform the default measure step. More...
 
kzsError kzuObjectNodeDefaultArrange (struct KzuObjectNode *objectNode)
 Perform the default arrange step. More...
 
struct KzuObjectNodekzuObjectNodeGetRelative (struct KzuObjectNode *objectNode, kzString relativePath)
 Get an object node by another node and a relative path. More...
 
kzsError kzuObjectNodeAddTimeLineEntry (struct KzuObjectNode *objectNode, struct KzuTimeLineEntry *timeLineEntry)
 Adds timeline entry for object's animation player. More...
 
kzsError kzuObjectNodeAddAnimationItem (struct KzuObjectNode *objectNode, struct KzuAnimationItem *animationItem, kzBool reverse, kzInt repeatCount, struct KzuTimeLineEntry **out_timeLineEntry)
 Adds animation item for object's animation player. More...
 
void kzuObjectNodeSetAnimationPlayerTimeRecursive (const struct KzuObjectNode *objectNode, kzFloat currentTime)
 Set animation player time in an object and all of its children. More...
 
kzsError kzuObjectCreateAnimationPlayerAttachToParentPlayer (struct KzuObjectNode *objectNode, struct KzuAnimationPlayer **out_animationPlayer)
 Create an animation player that references this object node, attach to an animation player in parent node. More...
 
kzsError kzuObjectNodeCreateAnimationPlayerAttachToTaskScheduler (struct KzuObjectNode *objectNode, struct KzuAnimationPlayer **out_animationPlayer)
 Create an animation player that references this object node, attach to the master animation player in task scheduler. More...
 
kzsError kzuObjectNodeAnimationPlayerAttachToTaskScheduler (const struct KzuObjectNode *objectNode, struct KzuAnimationPlayer *animationPlayer)
 Attach given animation player to the task scheduler acquired via the object node. More...
 
struct KzuAnimationPlayerkzuObjectNodeGetAnimationPlayer (const struct KzuObjectNode *objectNode)
 Returns animation player from object node. More...
 
struct KzuMaterialkzuObjectNodeGetFirstMaterial (const struct KzuObjectNode *objectNode)
 Gets first material from given object node tree. More...
 
struct KzuObjectNodeTreeIterator kzuObjectNodeGetTreeIterator (struct KzuObjectNode *rootObjectNode)
 Returns a tree iterator to object node graph. More...
 
kzBool kzuObjectNodeTreeIterate_private (struct KzuObjectNodeTreeIterator *iterator)
 
struct KzuObjectNodekzuObjectNodeTreeIteratorGetValue_private (const struct KzuObjectNodeTreeIterator *iterator)
 
struct KzuObjectNodeChildIterator kzuObjectNodeGetChildIterator (struct KzuObjectNode *objectNode)
 Returns an object node child iterator. More...
 
kzBool kzuObjectNodeChildIterate_private (struct KzuObjectNodeChildIterator *iterator)
 
struct KzuObjectNodekzuObjectNodeChildIteratorGetValue_private (const struct KzuObjectNodeChildIterator *iterator)
 
kzsError kzuObjectNodeChildIteratorRemove_private (struct KzuObjectNodeChildIterator *iterator)
 

Variables

KZ_HEADER_BEGIN const KzuObjectType KZU_OBJECT_TYPE_RENDERABLE
 Object type identifier for all renderable object types. More...
 

Detailed Description

Base structure for scene graph nodes.

KzuObjectNode contains information of the node type (mesh, light, camera, ...), transformation, list of child object nodes and set of properties.

Object Node Messages

KzuObjectNode does not send or receive any (public) messages.

Object Node Properties

KZU_PROPERTY_TYPE_STATE_MANAGER resource ID property specifies the KzuStateManager applied to the object node.

KZU_PROPERTY_TYPE_GESTURE_RECOGNIZER__CLICK Boolean property specifies whether or not the node should recognize clicks. The default value is KZ_FALSE.

KZU_PROPERTY_TYPE_STYLE_NAME resource ID property specifies a KzuStyle that will be applied to the node.

KZU_PROPERTY_TYPE_OBJECT_EXTERNAL_OWNERSHIP Boolean property specifies whether or not the node is owned by something else but its parent. If KZ_TRUE, the parent will not delete the child when the parent is deleted. The default value is KZ_FALSE.

KZU_PROPERTY_TYPE_TRANSFORMATION KzcMatrix4x4 property specifies the transformation matrix for the node. This property has no effect if the node is a KzuScene, then the identity matrix is used. The transformation matrix specifies the location, orientation and scale of the node relative to its parent node. This transformation is applied before the layout transformation set by the parent. The default value is the identity matrix.

KZU_PROPERTY_TYPE_RENDER_TRANSFORMATION KzcMatrix4x4 property specifies the render transformation matrix for the node. This transformation is applied after the KZU_PROPERTY_TYPE_TRANSFORMATION and layout transformation. The default value is the identity matrix.

KZU_PROPERTY_TYPE_LAYOUT_WIDTH float property specifies the width of the node when used in a layout. The default value is 0.

KZU_PROPERTY_TYPE_LAYOUT_HEIGHT float property specifies the height of the node when used in a layout. The default value is 0.

KZU_PROPERTY_TYPE_LAYOUT_DEPTH float property specifies the depth of the node when used in a layout. The default value is 0.

KZU_PROPERTY_TYPE_LAYOUT_HORIZONTAL_ALIGNMENT integer property specifies the alignment in horizontal direction the node should use when it resides under a layout. The value should be one of KzuObjectNodeHorizontalAlignment values. The default value is KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_CENTER.

KZU_PROPERTY_TYPE_LAYOUT_VERTICAL_ALIGNMENT integer property specifies the alignment in vertical direction the node should use when it resides under a layout. The value should be one of KzuObjectNodeVerticalAlignment values. The default value is KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_CENTER.

KZU_PROPERTY_TYPE_LAYOUT_DEPTH_ALIGNMENT integer property specifies the alignment in depth direction the node should use when it resides under a layout. The value should be one of KzuObjectNodeDepthAlignment values. The default value is KZU_OBJECT_NODE_DEPTH_ALIGNMENT_CENTER.

KZU_PROPERTY_TYPE_LAYOUT_HORIZONTAL_MARGIN KzcVector2 property specifies the margin in horizontal direction the node should use when it resides under a layout. The two floats specify the margin for the left and right side of the object respectively. The default value is {0, 0}.

KZU_PROPERTY_TYPE_LAYOUT_VERTICAL_MARGIN KzcVector2 property specifies the margin in vertical direction the node should use when it resides under a layout. The two floats specify the margin for the bottom and top side of the object respectively. The default value is {0, 0}.

KZU_PROPERTY_TYPE_LAYOUT_DEPTH_MARGIN KzcVector2 property specifies the margin in depth direction the node should use when it resides under a layout. The two floats specify the margin for the back and front side of the object respectively. The default value is {0, 0}.

KZU_PROPERTY_TYPE_HIT_TESTABLE Boolean property specifies whether or not the node can be picked and is sensitive to user input in the 3D scene. The default value is KZ_FALSE.

KZU_PROPERTY_TYPE_HIT_TESTABLE_CONTAINER Boolean property specifies whether or not the actual size (from kzuObjectNodeGetActualSize) of the node is used for hit testing. If the property is KZ_FALSE, the bounding box (from kzuObjectNodeGetBoundingVolume) of the node is used instead if available. The default value is KZ_FALSE.

KZU_PROPERTY_TYPE_VISIBLE Boolean property specifies whether or not the node should be rendered. The default value is KZ_TRUE.

KZU_PROPERTY_TYPE_FRUSTUM_CULL_MARGIN float property specifies the margin of the frustum cull radius of the node. Useful when, for example, vertex shaders modify the geometry and frustum culling would interfere with that. The default value is 0.

KZU_PROPERTY_TYPE_ENABLED Boolean property specifies whether or not the node receives input but ignores it. I.e. if the value is KZ_FALSE, the node receives input but does not handle it. The default value is KZ_TRUE.

KZU_PROPERTY_TYPE_FOCUSABLE Boolean property specifies whether or not the node accepts focus. The default value is KZ_TRUE.

KZU_PROPERTY_TYPE_FOCUSED Boolean property is set KZ_TRUE when the node has the focus, otherwise it is KZ_FALSE. Key events are delivered first to the focused node.

KZU_PROPERTY_TYPE_PARTIAL_RENDERING_FORCE_RENDER Boolean property specifies whether or not to force partial rendering update even if object was not otherwise changed. This property has an effect only when using a KzuPartialRenderingComposer to render the node. The default value is KZ_FALSE.

KZU_PROPERTY_TYPE_PARTIAL_RENDERING_STENCIL_OBJECT pointer property specifies a subtree of nodes used as the stencil mesh for the object node in partial rendering. This property has an effect only when using a KzuPartialRenderingComposer to render the node. The default value is KZ_NULL.

KZU_PROPERTY_TYPE_CONSTRAINT_POSITION pointer property specifies a target KzuObjectNode which translation is used for this object node.

KZU_PROPERTY_TYPE_CONSTRAINT_IN_WORLD_COORDINATES Boolean property specifies whether or not the KZU_PROPERTY_TYPE_CONSTRAINT_POSITION and KZU_PROPERTY_TYPE_CONSTRAINT_ORIENTATION properties' corresponding KzuTransformedObjectNode (KZ_TRUE) or the target KzuObjectNode itself (KZ_FALSE) is used for getting the transformation matrix.

KZU_PROPERTY_TYPE_CONSTRAINT_ORIENTATION pointer property specifies a target KzuObjectNode which rotation is used for this object node.

KZU_PROPERTY_TYPE_LOOK_AT pointer property specifies a target KzuObjectNode that the KzuTransformedObjectNode corresponding to the object node having the property will be made to "look at" by changing its orientation. The final transformation of the KzuObjectNode having this property is not changed.

KZU_PROPERTY_TYPE_OBJECT__PATH is an internal property used by Kanzi.

KZU_PROPERTY_TYPE_OBJECT_NODE_PREFAB_TEMPLATE_SOURCE is an internal property used by Kanzi.

Copyright 2008-2019 by Rightware. All rights reserved.

Macro Definition Documentation

#define kzuObjectNodeTreeIterate (   iterator_param)

Finds the next entry in the object node tree iterator.

Returns KZ_TRUE if next entry is found, otherwise KZ_FALSE.

#define kzuObjectNodeTreeIteratorGetValue (   iterator_param)

Returns the current object node in the object node tree iterator.

#define kzuObjectNodeChildIterate (   iterator_param)

Finds the next entry in the object node child iterator.

Returns KZ_TRUE if next entry is found, otherwise KZ_FALSE.

#define kzuObjectNodeChildIteratorGetValue (   iterator_param)

Returns the current object node in the object node child iterator.

#define kzuObjectNodeChildIteratorRemove (   iterator_param)

Removes the current child object node from the iterated object node.

Enumeration Type Documentation

Horizontal alignment.

Enumerator
KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_LEFT 
KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_RIGHT 
KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_CENTER 
KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_STRETCH 
KZU_OBJECT_NODE_HORIZONTAL_ALIGNMENT_COUNT 

Last enum value for validity checks.

Vertical alignment.

Enumerator
KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_BOTTOM 
KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_TOP 
KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_CENTER 
KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_STRETCH 
KZU_OBJECT_NODE_VERTICAL_ALIGNMENT_COUNT 

Last enum value for validity checks.

Depth alignment.

Enumerator
KZU_OBJECT_NODE_DEPTH_ALIGNMENT_BACK 
KZU_OBJECT_NODE_DEPTH_ALIGNMENT_FRONT 
KZU_OBJECT_NODE_DEPTH_ALIGNMENT_CENTER 
KZU_OBJECT_NODE_DEPTH_ALIGNMENT_STRETCH 
KZU_OBJECT_NODE_DEPTH_ALIGNMENT_COUNT 

Last enum value for validity checks.

Function Documentation

kzsError kzuObjectNodeInitialize ( struct KzuObjectNode objectNode)

Initializes an object node.

kzsError kzuObjectNodeUninitialize ( struct KzuObjectNode objectNode)

Uninitializes an object node.

kzsError kzuObjectNodeLoadFromKZB ( struct KzuObjectNode objectNode,
struct KzcInputStream inputStream,
const struct KzuBinaryFileInfo file 
)

Loads object node from binary.

kzsError kzuObjectNodeDelete ( struct KzuObjectNode objectNode)

Deletes an object node and all its children recursively.

  • Traverses the tree depth-first. Objects are uninitialized before deletion. Removes all deleted object nodes from their parents.
kzsError kzuObjectNodeDeleteAsync ( struct KzuObjectNode object)

Deletes an object node and all its children in the idle loop.

struct KzuPropertyManager* kzuObjectNodeGetPropertyManager ( const struct KzuObjectNode objectNode)

Get the property manager associated with an object node.

struct KzuMessageDispatcher* kzuObjectNodeGetMessageDispatcher ( const struct KzuObjectNode objectNode)

Get the message dispatcher associated with an object node.

struct KzuUIDomain* kzuObjectNodeGetUIDomain ( const struct KzuObjectNode objectNode)

Get the UIDomain associated with an object node.

kzsError kzuObjectNodeRemoveKZBData ( const struct KzuObjectNode objectNode)

Destroys all object node data loaded from KZB, including properties, bindings, triggers, resources etc.

kzsError kzuObjectNodeCopy ( const struct KzcMemoryManager memoryManager,
const struct KzuObjectNode sourceObject,
struct KzuObjectNode **  out_objectNode 
)

Creates a copy of given object node without any of its descendants.

All properties in the objects are also copied. New nodes will contain references to the data of the source objects. Copying attached nodes is not supported.

kzsError kzuObjectNodeCopyWithChildren ( const struct KzcMemoryManager memoryManager,
const struct KzuObjectNode sourceObject,
struct KzuObjectNode **  out_objectNode 
)

Creates a copy of given object node and all its descendants.

All properties in the objects are also copied. New nodes will contain references to the data of the source objects. Copying attached nodes is not supported.

struct KzuObjectNode* kzuObjectNodeGetParent ( const struct KzuObjectNode objectNode)

Gets the parent of an object node.

kzsError kzuObjectNodeRemoveFromParent ( struct KzuObjectNode objectNode)

Removes object from parent, if there is such.

kzBool kzuObjectNodeIsAncestorOf ( const struct KzuObjectNode parentNode,
const struct KzuObjectNode childNode 
)

Returns whether the parent node is the parent of the child node at any level in the scene graph hierarchy.

Parameters
parentNodeObject node to check whether it is the ancestor of childNode.
childNodeObject node to check whether it is the descendant of parentNode.
Returns
Returns KZ_TRUE if parentNode is the parent of childNode at any level, otherwise returns KZ_FALSE.
void kzuObjectNodeSetIsRenderable ( struct KzuObjectNode objectNode,
kzBool  state 
)

Sets whether the object node is renderable.

kzBool kzuObjectTypeIsRenderable ( const struct KzuObjectNode objectNode)

Returns whether given object node is renderable.

struct KzuObjectNode* kzuObjectNodeGetSceneObject ( const struct KzuObjectNode objectNode)

Gets the scene object node that contains the given object node.

struct KzuScene* kzuObjectNodeGetScene ( const struct KzuObjectNode objectNode)

As kzuObjectNodeGetSceneObject, but return as scene.

struct KzuLayer* kzuObjectNodeGetParentLayer ( const struct KzuObjectNode objectNode)

Gets the closest layer that is a parent of the given object node.

struct KzuLayer* kzuObjectNodeGetRootLayer ( struct KzuObjectNode objectNode)

Gets the root layer that contains the given object node.

struct KzuObjectNode* kzuObjectNodeGetRoot ( struct KzuObjectNode objectNode)

Gets the root object node from the given object, i.e.

such parent node that doesn't contain parent anymore, can be any type (e.g. screen, scene, layer, empty node).

struct KzuScreen* kzuObjectNodeGetScreen ( struct KzuObjectNode objectNode)

Gets the root screen object from the given object.

If the object node is not attached to a screen, returns KZ_NULL.

kzBool kzuObjectNodeIsAttached ( const struct KzuObjectNode objectNode)

Returns KZ_TRUE if the object node is attached to a screen or one of its descendants.

kzBool kzuObjectNodeIsDetaching ( const struct KzuObjectNode objectNode)

Returns KZ_TRUE during the call to virtual kzuObjectNodeOnDetached and KZ_FALSE otherwise.

kzsException kzuObjectNodeAddChild ( struct KzuObjectNode parentObject,
struct KzuObjectNode childNode 
)

Adds a child node for object node.

Adding a 3D object node as a child of a 2D object node is only allowed when adding a scene to a viewport layer. Screens can have only one child which is a layer.

Returns
KZS_SUCCESS on success. KZU_EXCEPTION_INVALID_ADD_CHILD_OPERATION if the above rules are violated.
kzsException kzuObjectNodeAddChildAtIndex ( struct KzuObjectNode parentObject,
kzUint  index,
struct KzuObjectNode childNode 
)

Adds a child node for object node to given index.

Adding a 3D object node as a child of a 2D object node is only allowed when adding a scene to a viewport layer. Screens can have only one child which is a layer.

Returns
KZS_SUCCESS on success. KZU_EXCEPTION_INVALID_ADD_CHILD_OPERATION if the above rules are violated.
kzsError kzuObjectNodeRemoveChild ( struct KzuObjectNode parentObject,
struct KzuObjectNode childObject 
)

Removes child node from parent object.

kzsError kzuObjectNodeRemoveChildByIndex ( struct KzuObjectNode parentObject,
kzUint  index 
)

Removes child node from parent object node at specified index.

kzsError kzuObjectNodeRemoveAllChildren ( struct KzuObjectNode parentObject)

Removes all child nodes from parent object.

kzBool kzuObjectNodeHasChild ( const struct KzuObjectNode parentObjectNode,
const struct KzuObjectNode childObjectNode 
)

Checks if parent object node contains child object node.

kzBool kzuObjectNodeHasChildSafe ( const struct KzuObjectNode parentObjectNode,
const struct KzuObjectNode childObjectNode 
)

Checks if parent object node contains child object node.

It's safe to use this function even if the child node may not be valid.

kzUint kzuObjectNodeGetChildCount ( const struct KzuObjectNode parentObject)

Gets child count from object.

struct KzcDynamicArrayIterator kzuObjectNodeGetChildren ( const struct KzuObjectNode objectNode)

Returns child objects as iterator from object node.

struct KzuObjectNode* kzuObjectNodeGetChildAtIndex ( const struct KzuObjectNode objectNode,
kzUint  index 
)

Returns a child from given index from object node.

kzsError kzuObjectNodeGetIndexOfChild ( const struct KzuObjectNode parentObjectNode,
const struct KzuObjectNode childObjectNode,
kzUint out_index 
)

Returns the index of a child in an object node.

kzsError kzuObjectNodeSetName ( struct KzuObjectNode objectNode,
kzString  name 
)

Sets a name for object node.

kzString kzuObjectNodeGetName ( const struct KzuObjectNode objectNode)

Returns an object node's name.

kzsError kzuObjectNodeGetPath ( const struct KzuObjectNode objectNode,
kzMutableString out_path 
)

Returns the full path to this object node.

The returned string must be freed with kzcStringDelete.

kzsError kzuObjectNodeGetPathForStudio ( const struct KzuObjectNode objectNode,
kzMutableString out_path 
)

Returns a studio-friendly (not including nodes that studio does not know about) full path to this object node.

The returned string must be freed with kzcStringDelete.

kzUint kzuObjectNodeGetTreeHeight ( struct KzuObjectNode objectNode)

Gets tree height from the object node to the parent, if no parents, height = 1, if single parent, and parent's parent = NULL, height = 2 and so on.

kzsError kzuObjectNodeGetRelativePath ( struct KzuObjectNode targetObjectNode,
struct KzuObjectNode baseObjectNode,
kzMutableString out_path 
)

Returns the relative path from base object node to target object node, KZ_NULL if not found.

The returned string must be freed with kzcStringDelete.

kzBool kzuObjectNodeIsTypeOf ( const struct KzuObjectNode objectNode,
const KzuObjectType  objectType 
)

Returns whether object node or one of its base types is of the given type.

KzuObjectType kzuObjectNodeGetType ( const struct KzuObjectNode objectNode)

Returns object node's type, KZU_OBJECT_TYPE_X.

struct KzcVector3 kzuObjectNodeGetPositionVector ( const struct KzuObjectNode objectNode)

Returns the position of the object node as vector3.

kzsError kzuObjectNodeSetIdentityTransformation ( const struct KzuObjectNode objectNode)

Sets an identity matrix for object node.

kzsError kzuObjectNodeSetIdentity3x3Transformation ( const struct KzuObjectNode objectNode)

Sets a top left 3x3 part of object node transformation as identity (clear rotation & scaling).

Leaves other parts of matrix untouched.

kzsError kzuObjectNodeTranslate ( const struct KzuObjectNode objectNode,
kzFloat  x,
kzFloat  y,
kzFloat  z 
)

Translates object node.

kzsError kzuObjectNodeSetPosition ( const struct KzuObjectNode objectNode,
kzFloat  x,
kzFloat  y,
kzFloat  z 
)

Sets position for object node.

kzsError kzuObjectNodeRotate ( const struct KzuObjectNode objectNode,
kzFloat  angleInDegrees,
kzFloat  x,
kzFloat  y,
kzFloat  z 
)

Rotates object node by specific axis, rotation angle in degrees.

kzsError kzuObjectNodeScale ( const struct KzuObjectNode objectNode,
kzFloat  scale 
)

Scales object node uniformly.

kzsError kzuObjectNodeScaleXYZ ( const struct KzuObjectNode objectNode,
kzFloat  scaleX,
kzFloat  scaleY,
kzFloat  scaleZ 
)

Scales object node non-uniformly.

struct KzuObjectNode* kzuObjectNodeFindFirstChildOfType ( struct KzuObjectNode rootObjectNode,
KzuObjectType  objectType 
)

Finds first object node of given type from root nodes' hierarchy.

struct KzuObjectNode* kzuObjectNodeFindObjectNodeByName ( struct KzuObjectNode rootObjectNode,
kzString  objectName 
)

Finds object node from root nodes' hierarchy by object name.

KZ_NULL if no object was found.

struct KzuObjectNode* kzuObjectNodeFindObjectNodeContainingPropertyType ( struct KzuObjectNode rootObjectNode,
const struct KzuPropertyType propertyType 
)

Finds first object node from root nodes' hierarchy.

KZ_NULL if no object was found.

kzsError kzuObjectNodeOnPropertyChanged ( struct KzuObjectNode objectNode,
const struct KzuPropertyType propertyType,
enum KzuPropertyNotificationReason  reason 
)

Notifies the object node about a changed property.

kzsError kzuObjectNodeGetBoundingVolume ( const struct KzuObjectNode objectNode,
struct KzuBoundingVolume **  out_boundingVolume 
)

Gets bounding volume from object node.

Returns KZ_NULL if the object is not renderable.

kzsError kzuObjectNodeRender ( struct KzuRenderer renderer,
const struct KzuObjectNode objectNode,
const struct KzuTransformedObjectNode transformedObjectNode,
struct KzcMatrix4x4 worldTransformation 
)

Renders the object if the object type has specified a renderer function.

kzsError kzuObjectNodeGetSize ( const struct KzuObjectNode objectNode,
struct KzcVector3 out_size 
)

Returns the size of given object node.

kzsError kzuObjectNodeGetMaximumBoundingBoxCoordinates ( const struct KzuObjectNode objectNode,
struct KzcVector3 out_size 
)

Returns the minimum coordinates for given object nodes bounding volume.

kzsError kzuObjectNodeGetMinimumBoundingBoxCoordinates ( const struct KzuObjectNode objectNode,
struct KzcVector3 out_size 
)

Returns the maximum coordinates for given object nodes bounding volume.

kzsError kzuObjectNodeAddResource ( const struct KzuObjectNode objectNode,
kzString  resourceId,
kzString  resourceUrl 
)

Adds a resource manager resource to an object node.

If resourceID already exists in object, removes the existing entry. If resourceURL is NULL, error is thrown.

kzsError kzuObjectNodeRemoveResource ( const struct KzuObjectNode objectNode,
kzString  resourceId 
)

Removes a resource with given ID from object node resource dictionary.

Does not do anything if resourceID was not found.

kzBool kzuObjectNodeContainsResource ( const struct KzuObjectNode objectNode,
kzString  resourceID 
)

Returns if object node resource dictionary contains the resource with given ID.

Resource can be any type: style, alias or resource manager resource.

kzsError kzuObjectNodeAddAnonymousResource ( struct KzuObjectNode objectNode,
struct KzuResource resource 
)

Adds anonymous resource (such as style) for object node resources.

kzsError kzuObjectNodeRemoveAnonymousResource ( struct KzuObjectNode objectNode,
struct KzuResource resource 
)

Removes anonymous resource from object node resources.

kzsError kzuObjectNodeAddAnonymousResourceURL ( struct KzuObjectNode objectNode,
kzString  resourceURL 
)

Adds anonymous resource (such as style) acquired from the given URL for object node resources.

kzsError kzuObjectNodeRemoveAnonymousResourceURL ( struct KzuObjectNode objectNode,
kzString  resourceURL 
)

Removes anonymous resource from the given URL from object node resources.

kzsError kzuObjectNodeAddAliasResource ( const struct KzuObjectNode objectNode,
kzString  resourceId,
kzString  targetPath 
)

Adds alias resource to an object node.

kzsError kzuObjectNodeRemoveAliasResource ( const struct KzuObjectNode objectNode,
kzString  resourceId 
)

Removes alias resource from an object node.

kzsException kzuObjectNodeAcquireResource ( const struct KzuObjectNode objectNode,
kzString  resourceId,
struct KzuResource **  out_resource 
)

Acquires a resource from the object node or the node's closest ancestor having the resource.

Acquiring a resource increases its reference count by one. The caller should call kzuResourceRelease to decrease the reference count by one after she is done with it.

Parameters
objectNodeThe search of the resource resourceId starts from this object node and continues to the node's ancestors.
resourceIdName of the resource.
out_resourceA pointer that is set to point to the resource if it is found or KZ_NULL.
kzsError kzuObjectNodeCopyResources ( const struct KzuObjectNode sourceObjectNode,
struct KzuObjectNode targetObjectNode,
kzBool  preserveTarget 
)

Copy resources from one object node to another.

Parameters
preserveTargetFlag indicates whether preserve resource in resource dictionary of target node.
struct KzcDynamicArrayIterator kzuObjectNodeGetResources ( const struct KzuObjectNode objectNode)

Gets all resources of the object node.

struct KzuObjectNodeResourceDictionary* kzuObjectNodeGetResourceDictionary ( const struct KzuObjectNode objectNode)

Gets all resources of the object node.

kzsError kzuObjectNodeAttachInputManipulator ( struct KzuObjectNode objectNode,
struct KzuInputManipulator inputManipulator 
)

Transfers the ownership and attaches an input manipulator to an object node.

kzsError kzuObjectNodeDetachInputManipulator ( const struct KzuObjectNode objectNode,
struct KzuInputManipulator inputManipulator 
)

Removes the ownership and detaches an input manipulator from an object node.

struct KzcDynamicArrayIterator kzuObjectNodeGetInputManipulators ( const struct KzuObjectNode objectNode)

Gets the input manipulator iterator.

kzsError kzuObjectNodeAddBinding ( struct KzuObjectNode objectNode,
struct KzuBindingRule rule 
)

Transfers the ownership of a binding rule to an object node.

kzsError kzuObjectNodeAddBindingWithOwner ( struct KzuObjectNode objectNode,
struct KzuBindingRule rule,
const void owner 
)

Transfers the ownership of a binding rule to an object node and sets the owner of binding rule.

kzsError kzuObjectNodeRemoveBinding ( const struct KzuObjectNode objectNode,
struct KzuBindingRule rule 
)

Removes the ownership and detaches a binding rule from an object node.

struct KzcDynamicArrayIterator kzuObjectNodeGetBindings ( const struct KzuObjectNode objectNode)

Gets the bindings iterator.

kzsError kzuObjectNodeAddTrigger ( struct KzuObjectNode objectNode,
struct KzuTrigger trigger 
)

Transfers the ownership of a trigger to an object node.

kzsError kzuObjectNodeAddTriggerWithOwner ( struct KzuObjectNode objectNode,
struct KzuTrigger trigger,
const void owner 
)

Transfers the ownership of a trigger to an object node and sets the owner of the trigger.

kzsError kzuObjectNodeRemoveTrigger ( const struct KzuObjectNode objectNode,
struct KzuTrigger trigger 
)

Removes the ownership of a trigger from an object node.

struct KzcDynamicArrayIterator kzuObjectNodeGetTriggers ( const struct KzuObjectNode objectNode)

Gets the trigger iterator.

kzsError kzuObjectNodeSetTransformation ( const struct KzuObjectNode objectNode,
const struct KzcMatrix4x4 value 
)

Sets object node transformation from matrix.

struct KzcMatrix4x4 kzuObjectNodeGetTransformation ( const struct KzuObjectNode objectNode)

Calculates the node transformation from scaling, rotation, and translation properties.

For KzuScene this always returns an identity matrix regardless what SRT values have been set. This simplifies calculations relative to the scene (e.g. bounding boxes).

kzsError kzuObjectNodeSetLayoutTransformation ( struct KzuObjectNode objectNode,
const struct KzcMatrix4x4 value 
)

Sets the layout transformation of the object.

kzsError kzuObjectNodeGetLayoutTransformation ( struct KzuObjectNode objectNode,
struct KzcMatrix4x4 out_value 
)

Gets the layout transformation of the object.

void kzuObjectNodeSetFinalTransformation ( struct KzuObjectNode objectNode,
const struct KzcMatrix4x4 value 
)

Sets the final transformation of the object.

void kzuObjectNodeGetFinalTransformation ( const struct KzuObjectNode objectNode,
struct KzcMatrix4x4 out_value 
)

Gets the final transformation of the object.

struct KzcMatrix4x4 kzuObjectNodeGetBaseTransformationDefaultFromSRT ( const struct KzuObjectNode objectNode)

Calculates the node base transformation from scaling, rotation, and translation properties.

kzBool kzuObjectNodeIsEffectivelyVisible ( const struct KzuObjectNode objectNode)

Checks if the node and all of its ancestors are visible.

kzBool kzuObjectNodeIsEffectivelyEnabled ( const struct KzuObjectNode objectNode)

Checks if the node and all of its ancestors are enabled.

void kzuObjectNodeSetChangeFlag ( struct KzuObjectNode objectNode,
kzU32  flag 
)

Set a change flag.

void kzuObjectNodeClearChangeFlag ( struct KzuObjectNode objectNode,
kzU32  flag 
)

Clear a change flag.

kzBool kzuObjectNodeIsChangeFlagSet ( const struct KzuObjectNode objectNode,
kzU32  flag 
)

Check if a change flag is set.

void kzuObjectNodeSetChildChangeFlag ( struct KzuObjectNode objectNode,
kzU32  flag 
)

Set an child change flag.

void kzuObjectNodeClearChildChangeFlag ( struct KzuObjectNode objectNode,
kzU32  flag 
)

Clear an child change flag.

kzBool kzuObjectNodeIsChildChangeFlagSet ( const struct KzuObjectNode objectNode,
kzU32  flag 
)

Check if child change flags match.

kzBool kzuObjectNodeIsAnyChildChangeFlagSet ( const struct KzuObjectNode objectNode,
kzU32  flag 
)

Check if any child change flags (corresponding to given mask) are set.

kzBool kzuObjectNodeIsInvalidLayout ( const struct KzuObjectNode objectNode)

Check if layout is invalid for a node.

void kzuObjectNodeInvalidateLayout ( struct KzuObjectNode objectNode)

Invalidate layout for an object node.

void kzuObjectNodeInvalidateLayoutRecursive ( struct KzuObjectNode objectNode)

Invalidate layout for an object node and all of its children.

void kzuObjectNodeValidateLayout ( struct KzuObjectNode objectNode)

Validate layout for an object node.

kzBool kzuObjectNodeIsInvalidArrange ( const struct KzuObjectNode objectNode)

Check if a node needs arrange.

void kzuObjectNodeInvalidateArrange ( struct KzuObjectNode objectNode)

Invalidate arrange.

void kzuObjectNodeValidateArrange ( struct KzuObjectNode objectNode)

Validate arrange.

kzBool kzuObjectNodeIsInvalidRender ( const struct KzuObjectNode objectNode)

Returns if object node render flag is invalid.

void kzuObjectNodeValidateRender ( struct KzuObjectNode objectNode)

Validates render for object node.

void kzuObjectNodeInvalidateRender ( struct KzuObjectNode objectNode)

Invalidates render for object node.

void kzuObjectNodeInvalidateRenderRecursive ( struct KzuObjectNode objectNode)

Invalidates render recursively for object node.

kzBool kzuObjectNodeIsInvalidRenderTree ( const struct KzuObjectNode objectNode)

Returns if object node render tree flag is invalid.

void kzuObjectNodeValidateRenderTree ( struct KzuObjectNode objectNode)

Validates render tree flag of object node.

void kzuObjectNodeInvalidateRenderTree ( struct KzuObjectNode objectNode)

Invalidates render tree flag of object node.

kzBool kzuObjectNodeIsInvalidRenderSubmask ( const struct KzuObjectNode objectNode)

Returns if object render sub mask flag is invalid.

void kzuObjectNodeInvalidateRenderSubmask ( struct KzuObjectNode objectNode)

Invalidates render submask for object node.

Can be validated with

kzBool kzuObjectNodeIsInvalidPartialRenderingObject ( const struct KzuObjectNode objectNode)

Helper function for observing if object is invalid partial rendering object (needs re-render).

void kzuObjectNodeInvalidatePartialRenderingObject ( struct KzuObjectNode objectNode)

Helper function for invalidating partial rendering object (rerender will be required with partial rendering).

void kzuObjectNodeIsInvalidPartialRenderingObjectRecursive ( struct KzuObjectNode objectNode)

Helper function for invvalidating partial rendering object recursively (rerender will be required with partial rendering).

void kzuObjectNodeValidatePartialRenderingObject ( struct KzuObjectNode objectNode)

Helper function for validating partial rendering object (no more rerender is required).

kzBool kzuObjectNodeIsInvalidPartialRenderingTree ( const struct KzuObjectNode objectNode)

Helper function for observing if object triee is invalid for partial rendering (needs re-render).

void kzuObjectNodeInvalidatePartialRenderingTree ( struct KzuObjectNode objectNode)

Helper function for invalidating partial rendering tree (rerender will be required).

void kzuObjectNodeValidatePartialRenderingTree ( struct KzuObjectNode objectNode)

Helper function for validating partial rendering tree (no more rerender is required).

kzsError kzuObjectNodeSetContentDesiredSize ( struct KzuObjectNode objectNode,
const struct KzcVector3 contentDesiredSize 
)

Set content desired size for an object.

kzsError kzuObjectNodeGetContentDesiredSize ( struct KzuObjectNode objectNode,
struct KzcVector3 contentDesiredSize 
)

Get content desired size of an object.

kzsError kzuObjectNodeSetCoreDesiredSize ( struct KzuObjectNode objectNode,
const struct KzcVector3 coreDesiredSize 
)

Set core desired size for an object.

kzsError kzuObjectNodeGetCoreDesiredSize ( struct KzuObjectNode objectNode,
struct KzcVector3 coreDesiredSize 
)

Get core desired size of an object.

kzsError kzuObjectNodeSetDesiredSize ( struct KzuObjectNode objectNode,
const struct KzcVector3 desiredSize 
)

Set desired size for an object.

kzsError kzuObjectNodeGetDesiredSize ( struct KzuObjectNode objectNode,
struct KzcVector3 desiredSize 
)

Get desired size for of object.

kzsError kzuObjectNodeSetAllocatedSize ( struct KzuObjectNode objectNode,
const struct KzcVector3 layoutSize 
)

Set allocated size for an object.

kzsError kzuObjectNodeGetAllocatedSize ( struct KzuObjectNode objectNode,
struct KzcVector3 layoutSize 
)

Get allocated size of an object.

kzsError kzuObjectNodeSetActualSize ( struct KzuObjectNode objectNode,
const struct KzcVector3 actualSize 
)

Set actual size for an object.

kzsError kzuObjectNodeGetActualSize ( struct KzuObjectNode objectNode,
struct KzcVector3 actualSize 
)

Get actual size of an object.

kzsError kzuObjectNodeSetLayoutBoundingBoxSize ( struct KzuObjectNode objectNode,
const struct KzcVector3 bboxMin,
const struct KzcVector3 bboxMax 
)

Set bounding box size for an object.

kzsError kzuObjectNodeGetLayoutBoundingBoxSize ( struct KzuObjectNode objectNode,
struct KzcVector3 out_bboxMin,
struct KzcVector3 out_bboxMax 
)

Get bounding box size for an object.

kzsError kzuObjectNodeSetAllocatedOffset ( struct KzuObjectNode objectNode,
const struct KzcVector3 allocatedOffset 
)

Set allocated offset for an object.

kzsError kzuObjectNodeGetAllocatedOffset ( struct KzuObjectNode objectNode,
struct KzcVector3 allocatedOffset 
)

Get allocated offset of an object.

kzsError kzuObjectNodeSetStretchScale ( struct KzuObjectNode objectNode,
const struct KzcVector3 stretchScale 
)

Set stretch scale for an object.

kzsError kzuObjectNodeGetStretchScale ( struct KzuObjectNode objectNode,
struct KzcVector3 stretchScale 
)

Get stretch scale of an object.

kzsError kzuObjectNodeSetPivotOffset ( struct KzuObjectNode objectNode,
const struct KzcVector3 pivotOffset 
)

Set pivot offset for an object.

kzsError kzuObjectNodeGetPivotOffset ( struct KzuObjectNode objectNode,
struct KzcVector3 pivotOffset 
)

Get pivot offset of an object.

kzsError kzuObjectNodeDefaultMeasure ( struct KzuObjectNode objectNode)

Perform the default measure step.

kzsError kzuObjectNodeDefaultArrange ( struct KzuObjectNode objectNode)

Perform the default arrange step.

struct KzuObjectNode* kzuObjectNodeGetRelative ( struct KzuObjectNode objectNode,
kzString  relativePath 
)

Get an object node by another node and a relative path.

kzsError kzuObjectNodeAddTimeLineEntry ( struct KzuObjectNode objectNode,
struct KzuTimeLineEntry timeLineEntry 
)

Adds timeline entry for object's animation player.

Parameters
timeLineEntryAnimation entry launched. KZ_NULL just to create the animation player.
kzsError kzuObjectNodeAddAnimationItem ( struct KzuObjectNode objectNode,
struct KzuAnimationItem animationItem,
kzBool  reverse,
kzInt  repeatCount,
struct KzuTimeLineEntry **  out_timeLineEntry 
)

Adds animation item for object's animation player.

Parameters
out_timeLineEntryResulting timeline entry. KZ_NULL if not wanted to use.
void kzuObjectNodeSetAnimationPlayerTimeRecursive ( const struct KzuObjectNode objectNode,
kzFloat  currentTime 
)

Set animation player time in an object and all of its children.

kzsError kzuObjectCreateAnimationPlayerAttachToParentPlayer ( struct KzuObjectNode objectNode,
struct KzuAnimationPlayer **  out_animationPlayer 
)

Create an animation player that references this object node, attach to an animation player in parent node.

kzsError kzuObjectNodeCreateAnimationPlayerAttachToTaskScheduler ( struct KzuObjectNode objectNode,
struct KzuAnimationPlayer **  out_animationPlayer 
)

Create an animation player that references this object node, attach to the master animation player in task scheduler.

kzsError kzuObjectNodeAnimationPlayerAttachToTaskScheduler ( const struct KzuObjectNode objectNode,
struct KzuAnimationPlayer animationPlayer 
)

Attach given animation player to the task scheduler acquired via the object node.

struct KzuAnimationPlayer* kzuObjectNodeGetAnimationPlayer ( const struct KzuObjectNode objectNode)

Returns animation player from object node.

struct KzuMaterial* kzuObjectNodeGetFirstMaterial ( const struct KzuObjectNode objectNode)

Gets first material from given object node tree.

struct KzuObjectNodeTreeIterator kzuObjectNodeGetTreeIterator ( struct KzuObjectNode rootObjectNode)

Returns a tree iterator to object node graph.

The iterator traverses the sub-tree from the given object node. Call kzuObjectNodeTreeIterate before accessing the first and any subsequent entries.

kzBool kzuObjectNodeTreeIterate_private ( struct KzuObjectNodeTreeIterator iterator)
struct KzuObjectNode* kzuObjectNodeTreeIteratorGetValue_private ( const struct KzuObjectNodeTreeIterator iterator)
struct KzuObjectNodeChildIterator kzuObjectNodeGetChildIterator ( struct KzuObjectNode objectNode)

Returns an object node child iterator.

The iterator returns each child of the object node. Call kzuObjectNodeChildIterate before accessing the first and any subsequent entries.

kzBool kzuObjectNodeChildIterate_private ( struct KzuObjectNodeChildIterator iterator)
struct KzuObjectNode* kzuObjectNodeChildIteratorGetValue_private ( const struct KzuObjectNodeChildIterator iterator)
kzsError kzuObjectNodeChildIteratorRemove_private ( struct KzuObjectNodeChildIterator iterator)

Variable Documentation

KZ_HEADER_BEGIN const KzuObjectType KZU_OBJECT_TYPE_RENDERABLE

Object type identifier for all renderable object types.